<!--
*@Author: QWP
*@Description: 抽屉
*@Date: 2024-09-30 11:04:28
-->
<template>
  <a-drawer v-bind="$attrs"
    :closable="$attrs['closable'] ?? false"
    @close="close">
    <template #extra>
      <CloseOutlined @click="iconClose"/>
    </template>
    <slot></slot>
    <template #footer>
      <slot name="footer"></slot>
    </template>
  </a-drawer>
</template>

<script lang='ts' setup>
defineOptions({
  name: 'u-drawer'
})
import { ref, reactive, computed, onMounted } from 'vue' 
import { storeToRefs } from 'pinia'
import { useRoute, useRouter } from 'vue-router'
import { CloseOutlined } from '@ant-design/icons-vue'

const emits = defineEmits(['update:open', 'close'])
const iconClose = () => {
  emits('update:open', false)
  emits('close', false)
}

const close = () => {
  emits('update:open', false)
  emits('close', false)
}
</script>

<style lang='scss' scoped>
</style>